/**
* 懒汉式（线程安全,同步代码块）初次加锁，之后不必。
* 优点：修复4的效率问题
* 缺点：无法保证唯一单例。A线程进入到锁,B线程也进入到IF判断,A线程创建实例后,B线程也会创建
* 
*/
class King {
	private static King kingInstance;
	
	private King() {}
	
	public static King getKingInstance() {
		if(kingInstance == null) {
			synchronized(King.class) {
				kingInstance = new King();
			}
		}
		return kingInstance;
		
	}
}